<?php

namespace App\Http\Controllers\Information;

use App\Common\Utils\JsonResponse;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;

class DownldController extends Controller
{
    /** @var \App\Services\System\LogService $logService */
    private $logService;
    /** @var \App\Services\Information\DownldService $downldService */
    private $downldService;

    /**
    * Create a new controller instance.
    *
    * @return void
    */
    public function __construct()
    {
        parent::__construct();
        $this->middleware('auth');
        $this->logService = app('logService');
        $this->downldService = app('downldService');
    }

    /**
     * @Description: 教师个人信息下载
     * @Author: kzj
     * @datetime: 2023-03-28
     */
    public function downloadTeacherInfo(Request $request)
    {
        try
        {
            $result = $this->downldService->download($request->all());
            return JsonResponse::success($result,'操作成功');  
        }
        catch(\Exception $e)
        {
            Log::error($e);
            return $this->error($e);
        }
    }
}
